<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>04_jsonObjectArray</title>
</head>
<body>
<script type="text/javascript">
  /*
    json数据是对象，对象是数组
   */
  let jsonObject = {
    "k1": ["北京", "天津", "上海"],
    "k2": ["中国", "美国", "英国"]
  }
  // 取出上海
  console.log(jsonObject.k1[2])

  // 分别取出k1和k2键的值，遍历
  for (let o in jsonObject) {
    for (let i = 0; i < jsonObject[o].length; i++) {
      console.log(jsonObject[o][i])
    }
  }
</script>
</body>
</html>